package com.zit.java.service.pay;

import com.zit.java.dao.TuitionFeeMapper;
import com.zit.java.dao.ZhifiPayListMapper;
import com.zit.java.pojo.TuitionFee;
import com.zit.java.pojo.ZhifiPayList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PayServiceImpl implements PayService {


    @Autowired
    private ZhifiPayListMapper zhifiPayListMapper;

    @Autowired
    private TuitionFeeMapper dao;


    @Override
    public List<TuitionFee> selectPayData() {
        List<TuitionFee> tuitionFeeList = dao.selectAllPayData();
        return tuitionFeeList;
    }

    @Override
    public TuitionFee selectByIdProject(Integer id) {
     TuitionFee tuitionFee =    dao.selectByPrimaryKey(id);
        return tuitionFee;
    }

    @Override
    public void savePayRecord(ZhifiPayList zhifiPayList) {
        zhifiPayListMapper.insert(zhifiPayList);
    }

    @Override
    public List<ZhifiPayList> queryList() {
        List<ZhifiPayList> zhifiPayLists = zhifiPayListMapper.selectByExample(null);
        return zhifiPayLists;
    }

    @Override
    public int delTradeById(Integer id) {
        int i = zhifiPayListMapper.deleteByPrimaryKey(id);
        return i;
    }

    @Override
    public void updStudentPayStudentStatus(Integer payStatus) {
        dao.updStudentPayStatusById(payStatus);
    }


}
